unit UDevCtrlAddEditBase;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, UAddEditBase, cxGraphics,
  cxLookAndFeels, cxLookAndFeelPainters, Vcl.Menus, dxSkinsCore,
  dxSkinOffice2016Colorful, System.ImageList, Vcl.ImgList, cxImageList,
  Vcl.StdCtrls, cxButtons, Vcl.ExtCtrls, cxControls, cxContainer, cxEdit,
  cxTextEdit, cxLabel, cxMaskEdit, cxDropDownEdit, Data.DB, MemDS, DBAccess, Uni;

type
  TfrmDevCtrlAddEditBase = class(TfrmAddEditBase)
    lblCtrlName: TcxLabel;
    edtName: TcxTextEdit;
    lblCtrlIP: TcxLabel;
    comTheme: TcxComboBox;
    lblTheme: TcxLabel;
    qryTmp: TUniQuery;
    edtIP: TcxMaskEdit;

    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }

    procedure InitThemeData;
  public
    { Public declarations }
  end;

var
  frmDevCtrlAddEditBase: TfrmDevCtrlAddEditBase;

implementation

uses
  UDM;

{$R *.dfm}

procedure TfrmDevCtrlAddEditBase.FormCreate(Sender: TObject);
begin
  inherited;

  InitThemeData;
end;

procedure TfrmDevCtrlAddEditBase.InitThemeData;
begin
  comTheme.Properties.Items.Clear;

  with qryTmp do
  begin
    Close;
    SQL.Text := 'select * from ThemeData order by ThemeID';
    Open;

    while not Eof do
    begin
      comTheme.Properties.Items.AddObject(FieldByName('ThemeName').AsString, TObject(FieldByName('ThemeID').AsInteger));

      Next;
    end;
  end;
end;

end.
